<!--
 * @Descripttion: 
 * @version: 
 * @Author: Jiang ShareFont
 * @Date: 2022-12-08 12:04:16
 * @LastEditors: 
 * @LastEditTime: 2023-06-15 14:51:23
-->
<template>
	<div class="header">
		<div class="logoImg">
    		 <img src="@/assets/image/logo2.png" alt=""  class="logo"/>
    		 <span>|</span>
    		 <a href="https://open.work.weixin.qq.com" target="_blank"><img src="https://open.work.weixin.qq.com/service/img?id=ww4244127678d07ae5&t=isp&c=white&s=small" srcset="https://open.work.weixin.qq.com/service/img?id=ww4244127678d07ae5&t=isp&c=white&s=small@2x 2x" referrerpolicy="unsafe-url" alt="企业微信"></a>
    	</div>
    	<div class="menus">
			<el-menu
			  :default-active="activeName"
			  class="el-menu-demo"
			  mode="horizontal"
			 
			  background-color="#545c64"
			  text-color="#fff"
			  active-text-color="#ffd04b">
			  <el-menu-item index="userinfo" @click="navigatorHandle('/userinfo')">我的信息</el-menu-item>
			  <el-menu-item index="userlist" @click="navigatorHandle('/userlist')" v-if="agent==1 || usertype==1">人员管理</el-menu-item>
			  <el-menu-item index="order"  @click="navigatorHandle('/orderlist')">订单管理</el-menu-item>
        <el-menu-item index="allorder" v-if="is_manager==1"  @click="navigatorHandle('/allorderlist')">管理员查看全部订单</el-menu-item>

			  <!--<el-menu-item index="4">
			  	<a href="https://www.ele.me" target="_blank">订单管理</a>
			  </el-menu-item>-->
			</el-menu>
		</div>
		<div class="loginOut"  @click="lgoinOut">
			<span>登出</span>
		</div>
	</div>
</template>

<script>

	import Cookies from "js-cookie";
	
	export default {
	  name: 'headerCompent',
	   components: {
	
	  },
	  data () {
	    return {

	    
	    }
	  },
	  props: ['activeName','agent','usertype','is_manager'],
	  watch: {
	     agent : function(n,o){
	     	
			
	       
	    }
	
	  },
	  methods:{
	  	lgoinOut(){
	  		Cookies.remove('token');
	  		Cookies.remove('agent');
	  		Cookies.remove('usertype');
	  		this.$router.push('/login')
	  	},
	  	//领取裂变券
	  	navigatorHandle(e){
	  
	  		if(e == this.$route.path){
	  			return false;
	  		}
	  		else{
	  			this.$router.push(e);
	  		}
	  	}
	 
	  	
	  },
	  created(){
	  	 
	  },
	  mounted(){
	
	  }
	}
</script>

<style scoped  type="text/scss" lang="scss" >
	.header{
		display: flex;
		justify-content: space-between;
		align-items: center;
		background-color: rgb(84, 92, 100);
		.logoImg{
        	display: flex;
        	justify-content:space-around;
        	align-items: center;
        	margin:0 auto;
        	width:250px;
        	height: 61px;
        	padding:0 25px;
        	
        	.logo{
        		width: 66px;
                height: 37px;
        	}
        	span{
        		color: #ECECEC;
        	}
        	a{
        		img{
        			display: block;
        		}
        	}
        }
        .menus{
        	flex: 1;
        	padding-left: 50px;
        }
        .loginOut{
        	width: 40px;
        	line-height: 50px;
        	font-size: 12px;
        	color: #FFFFFF;
        	padding: 0 10px;
        	height: 50px;
        	cursor: pointer;
        }
	}

</style>